home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / comm / mail / iris.lha / Iris / MoveMsg.irx < prev    next >
Text File  |  1998-07-30  |  1KB  |  82 lines

  1. /* REXX script to transfer message(s) to another folder
  2.    $VER: MoveMsg.irx 1.2 (30.6.98) supplied with Iris V1.6
  3. */
  4.  
  5. /* address IRIS removed - now also usable from IRIS.n */
  6.  
  7. options results
  8. options failat 11
  9.  
  10. 'LOCKGUI'
  11.  
  12. signal on break_c
  13.  
  14. 'GETNUMSELECTED'
  15. n = result
  16. if rc > 0 then do
  17.     'ASKCHOICE "Transfer message(s)" "This script needs at*Nleast V1.3 of Iris." "**_OK"'
  18.     signal break_c
  19. end
  20. else nop
  21. if n = 0 then do
  22.     'ASKCHOICE "Transfer message(s)" "Select at least one*Nmessage first!" "**_OK"'
  23.     signal break_c
  24. end
  25. else nop
  26.  
  27. 'ASKFOLDER'
  28. if rc ~= 0 then do
  29.     signal break_c
  30. end
  31. else nop
  32. dest = result
  33.  
  34. 'GETFOLDER'
  35.  
  36. if result = dest then do
  37.     'ASKCHOICE "Transfer message(s)" "Impossible action:*NSame folder selected!" "**_OK"'
  38.     signal break_c
  39. end
  40. else nop
  41.  
  42. i = 0
  43. err = ''
  44. 'GETNUMSELECTED'
  45. n = result
  46. if rc > 0 then do
  47.     'ASKCHOICE "Transfer message(s)" "This script needs at*Nleast V1.3 of Iris." "**_OK"'
  48.     signal break_c
  49. end
  50. else nop
  51. if n = 0 then do
  52.     'ASKCHOICE "Transfer message(s)" "Did you click on the listview???" "**_OK"'
  53. end
  54. else nop
  55. do i=0 to n-1
  56.     'MESSAGEFILE' i
  57.     msg = result
  58.     if rc > 0 then do
  59.         err = 'Did you click on the listview???'
  60.         leave i
  61.     end
  62.     else nop
  63.     'READMESSAGE "'||msg||'" 0 TO "'||dest||'"'
  64.     if rc > 0 then do
  65.         err = 'The READMESSAGE command failed.'
  66.         leave i
  67.     end
  68.     else nop
  69. end
  70. if err ~= '' then do
  71.     'ASKCHOICE "Transfer message(s)" "'||err||'" "**_OK"'
  72. end
  73. else do
  74.     'DELETE'
  75. end
  76. signal break_c
  77. exit
  78.  
  79. break_c:
  80. 'UNLOCKGUI'
  81. exit
  82.